﻿//Author: Jacob Weber 
//Date: 04/10/2011    

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ExplodingCow.Basilisk.Logic
{
    /// <summary>
    /// Data Type representing the chracteristics of Shopping Items
    /// </summary>
    public class Item
    {
        /// <summary>
        /// Empty Constructor, initializes empty values for fields
        /// </summary>
        public Item()
        {

            name = "";
            description = "";
            Category = Logic.Category.None;
            storeLocation = new StoreLocation();
        }

        /// <summary>
        /// The name of the item
        /// </summary>
        string name;
        /// <summary>
        /// Name Property
        /// </summary>
        public string Name
        {
            get { return name; }
            set { name = value; }
        }
        /// <summary>
        /// The description of the item
        /// </summary>
        string description;
        /// <summary>
        /// Description Property
        /// </summary>
        public string Description
        {
            get { return description; }
            set { description = value; }
        }
        /// <summary>
        /// The cost of the item
        /// </summary>
        decimal cost;
        /// <summary>
        /// Decimal Cost Property
        /// </summary>
        public decimal Cost
        {
            get { return cost; }
            set { cost = value; }
        }
        /// <summary>
        /// the quanity or amount of the specific item 
        /// </summary>
        int quantity;
        /// <summary>
        /// Int Quantity Property
        /// </summary>
        public int Quantity
        {
            get { return quantity; }
            set { quantity = value; }
        }
        /// <summary>
        /// The category of the item
        /// </summary>
        Category category;
        /// <summary>
        /// Category Type Property (Enum)
        /// </summary>
        public Category Category
        {
            get { return category; }
            set { category = value; }
        }
        /// <summary>
        /// The store location of the item
        /// </summary>
        StoreLocation storeLocation;
        /// <summary>
        /// StoreLocation Type Property
        /// </summary>
        public StoreLocation StoreLocation
        {
            get { return storeLocation; }
            set { storeLocation = value; }
        }
        /// <summary>
        /// bool for whether the item is set to be removed
        /// </summary>
        bool removed = false;
        /// <summary>
        /// Get or Set whether the item should be removed
        /// </summary>
        public bool Removed
        {
            get { return removed; }
            set { removed = value; }
        }
        /// <summary>
        /// Sets all properties of the object to be the same as the object passed in
        /// </summary>
        /// <param name="itemToCopy">the specific item of data to copy</param>
        public void Copy(Item itemToCopy)
        { 
            //just used to simplify copying data back and forth
            this.Name = itemToCopy.Name;
            this.Category = itemToCopy.Category;
            this.Cost = itemToCopy.Cost;
            this.Description = itemToCopy.Description;
            this.Quantity = itemToCopy.Quantity;
            this.StoreLocation = itemToCopy.StoreLocation;
            //that should be all of the properties, except Removed which is used to manipulating data from the gui indirectly

        }
        /// <summary>
        /// The ToString override for Item object
        /// </summary>
        /// <returns>a string with specific format for Item name, cost, quantity</returns>
        public override string ToString()
        {
            return String.Format("{0} {1} {2}", Name, Cost, Quantity);
        }
    }
}
